//
//  BaseTabBarViewController.m
//  Router
//
//  Created by teki on 15/10/13.
//  Copyright © 2015年 dc. All rights reserved.
//

#import "BaseTabBarViewController.h"

@interface BaseTabBarViewController ()

@end

@implementation BaseTabBarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    UIView *bgView = [[UIView alloc] initWithFrame:self.tabBar.bounds];
    bgView.backgroundColor =  RGB(233, 233, 233);
    [self.tabBar insertSubview:bgView atIndex:0];
    self.tabBar.opaque = YES;

    NSArray *imageNames = @[@"tab_home",@"tab_scan",@"tab_manage",@"tab_settings"];
    NSArray *titles = @[@"WIFI管理",@"智能诊断",@"设备管理",@"系统设置"];
    for (NSInteger i =0; i<4; i++) {
        UITabBarItem *item = self.tabBar.items[i];
        NSString *selectImageName = [NSString stringWithFormat:@"%@_on",imageNames[i]];
        UIImage *selectImage= [UIImage imageNamed:selectImageName];
        selectImage = [selectImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
        UIImage *unSelectImage = [UIImage imageNamed:imageNames[i]];
        unSelectImage= [unSelectImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
        [item setTitleTextAttributes:@{NSForegroundColorAttributeName:RGB(86, 172, 76)} forState:UIControlStateSelected];
        [item setTitleTextAttributes:@{NSForegroundColorAttributeName:RGB(157, 160, 157)} forState:UIControlStateNormal];
        item = [item initWithTitle:titles[i] image:unSelectImage selectedImage:selectImage];
    }
    
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
